package org.gwt.grin.rebind.features;

import org.gwt.grin.client.features.Translator;
import org.gwt.grin.rebind.SEFeature;
import org.gwt.grin.rebind.ShowBuilder;

import com.google.gwt.uibinder.rebind.IndentedWriter;

public class SETranslator extends SEModifier {

	private SETranslatorModel model;

	public SETranslator(String name) {
		super(name);
	}

	public void setup(SETranslatorModel model, SEFeature part) {
		this.model = model;
		setPart(part);
	}

	public void setup(IndentedWriter w, ShowBuilder builder) {
		String vn = getVN(builder);
		w.write("%s.setup(%s, %s);", vn, model.getVN(builder),
				getPart().getVN(builder));
	}

	@Override
	protected String getClassName() {
		return Translator.class.getName();
	}

}
